﻿using System;
using SharpTrainer.DP.Flyweight.Generic;
using Zeus.Thunder.Core;

namespace SharpTrainer.DesignPattern
{
    class FlyweightGenTest : ITestCase
    {
        public void Run()
        {
            // Arbitrary extrinsic state 
            int extrinsicstate = 22; 
            FlyweightFactory f = new FlyweightFactory(); 
            
            // Work with different flyweight instances 
            Flyweight fx = f.GetFlyweight("X"); 
            fx.Operation(--extrinsicstate); 
            Flyweight fy = f.GetFlyweight("Y"); 
            fy.Operation(--extrinsicstate); 
            Flyweight fz = f.GetFlyweight("Z"); 
            fz.Operation(--extrinsicstate); 
            UnsharedConcreteFlyweight fu = new UnsharedConcreteFlyweight(); 
            fu.Operation(--extrinsicstate);
        }
    }
}
